import os
import sys

def get_base_path():
    """获取资源基础路径，支持打包后的 exe"""
    if getattr(sys, 'frozen', False):
        return sys._MEIPASS
    else:
        return os.path.abspath(".")

def get_model_path(weights_file="weights/best.pt"):
    base_path = get_base_path()
    return os.path.join(base_path, weights_file)
